/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edu.kamai.utility;

/**
 *
 * @author xyzhu
 */
public class TimeFormat {
    public static String retTimeFormatting(long s){
        long min = s / 60;
        long sec = s % 60;
        return min + "m:" + sec + "s";
    }
    
    public static long getSecFromFormatting(String tf){
        int pos = tf.indexOf("m:");
        String ms = tf.substring(0,pos);
        long m = 60 * Long.parseLong(ms);
        String sc = tf.substring(pos+2,tf.length()-1);
        long s = Long.parseLong(sc);
        return m+s;
    }
    
    /*
    public static void main(String[] args){
        System.out.print(TimeFormat.getSecFromFormatting("56m:34s"));
    }
     * 
     */
        
}
